package com.tj.mapper;
/**
 *
 * @author:王丽静
 * 接口 Doctor Mapper
 *
 */
import com.tj.pojo.Doctor;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DoctorMapper {
    @Select("select * from doctor")
    List<Doctor> findAllList();
    @Select("select * from doctor where realName like '%${value}%'")
    List<Doctor> findDocListByName(String realName);
    @Select("select * from doctor where docId=#{docId}")
    Doctor findDocById(int docId);
    @Insert("insert into doctor(docId, docCode, realName, password, sex, deptno) values (#{docId}, #{docCode}, #{realName},#{password}, #{sex}, #{deptno})")
    int insertDoctor(Doctor doctor);
    @Update("update doctor set docCode = #{docCode},realName = #{realName},password = #{password},sex = #{sex},deptno = #{deptno} where docId = #{docId}")
    int updateDoctor(Doctor doctor);
    @Delete("delete from doctor where docId = #{docId}")
    int deleteDoctor(Doctor doctor);
    @Select("select * from doctor where docCode = #{docCode} and password = #{password}")
    Doctor login(Doctor doctor);
}
